<%@page contentType="text/html; charset=UTF-8"%>
<%@taglib uri="/WEB-INF/struts-tags.tld" prefix="s"%>
<%@taglib uri="/WEB-INF/dianning.tld" prefix="dianning"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<title><dianning:webinfo type="area"/>房屋出租|<dianning:webinfo type="area"/>租房网<dianning:webinfo type="poweredby"/> </title>
<meta name="description" content="<dianning:webinfo type="area"/>租房网为您提供最新、最真实的<dianning:webinfo type="area"/>租房个人信息、<dianning:webinfo type="area"/>租房经纪人信息。 "/>
<meta name="keywords" content="<dianning:webinfo type="area"/>租房,<dianning:webinfo type="area"/>房屋出租"/>
<link href="/css/top.css" rel="stylesheet" type="text/css" />
<link href="/css/foot.css" rel="stylesheet" type="text/css" />
<link href="/css/post.css" rel="stylesheet" type="text/css" />
<link href="/css/validator.css" rel="stylesheet" type="text/css" />
<link href="/css/photoupload.css" rel="stylesheet" type="text/css" />
<link href="/css/jquery.wysiwyg.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" charset="utf-8" src="/js/jquery-1.4.2.min.js"></script>
<script type="text/javascript" charset="utf-8" src="/js/autoresize.min.js"></script>
<script type="text/javascript" charset="utf-8" src="/js/jquery_last.js"></script>
<script type="text/javascript" charset="utf-8" src="/js/formValidator.js"></script>
<script type="text/javascript" charset="utf-8" src="/js/formValidatorRegex.js"></script>
<script type="text/javascript" charset="utf-8" src="/js/photoupload.js"></script>
<script type="text/javascript" charset="utf-8" src="/js/jquery.wysiwyg.js"></script>
<script type="text/javascript" charset="utf-8" src="/js/nicEdit-latest.js"></script>
</head>

<body>
<div class="bgtop">
<s:include value="/top.jsp" />
</div>
<div class="content">
<UL id=navbar>
  <LI><I>1</I><a href="/post.action"><s:property value="bigChannel.channel.channelName"/></a></LI>
<s:url action="post?action=smallChannel" id="smallchannelUrl" includeParams="none">
	<s:param name="bid" value="bid"/>
</s:url>  
  <LI><I>2</I><s:a href="%{smallchannelUrl}"><s:property value="smallChannel.channel.channelName"/></s:a></LI>
<s:url action="post?action=area" id="areaUrl" includeParams="none">
	<s:param name="bid" value="bid"/>
	<s:param name="sid" value="sid"/>
</s:url> 
<s:if test="areaId==0">
   <LI><I>3</I><s:a href="%{smallchannelUrl}"><dianning:webinfo type="area"/></s:a></LI>
</s:if>
<s:else>
  <LI><I>3</I><s:a href="%{smallchannelUrl}"><s:property value="area.areaname"/></s:a></LI>
</s:else>
<s:url action="post?action=tradingArea" id="tradingAreaUrl" includeParams="none">
	<s:param name="bid" value="bid"/>
	<s:param name="sid" value="sid"/>
	<s:param name="areaId" value="areaId"/>
</s:url> 
<s:if test="tid==0">
<s:if test="areaId==0">
  <LI><I>4</I><a><dianning:webinfo type="area"/></a></LI>
</s:if>
<s:else>
  <LI><I>4</I><s:a href="%{tradingAreaUrl}"><s:property value="area.areaname"/></s:a></LI>
</s:else>
</s:if>
<s:else>
  <LI><I>4</I><s:a href="%{tradingAreaUrl}"><s:property value="tradingArea.tradingname"/></s:a></LI>
</s:else>
  <LI class=active><I>5</I>填写信息</LI></UL></DIV>	
<div class="content">

<ul class="pub_mainmnu  minheight">                                                                    
<form name="add" id="add" method="post" action="/house/zufang.action">
<s:hidden name="action"/>
<s:hidden name="bid" />
<s:hidden name="sid" />
<s:hidden name="areaId" />
<s:hidden name="tid" />
<SPAN>
<TABLE class=box1 id=formTb cellSpacing=0 cellPadding=0>
  <TBODY>
  <TR>
    <TD class=t><B class=red>*</B>出租方式： </TD>
    <TD>
	<label><input id="hireType_1" name="hireType" onclick="tojump(this)" value="2" type="radio" checked="checked" />整租</label> &nbsp;&nbsp;&nbsp;&nbsp;
	<label><input id="hireType_2" name="hireType" onclick="tojump(this)" value="0" type="radio" />单间</label> &nbsp;&nbsp;&nbsp;&nbsp;
	<label><input id="hireType_3" name="hireType" onclick="tojump(this)" value="1" type="radio" />床位</label>
	</TD>
  </TR>
  <TR>
    <TD class=t><B class=red>*</B> 标 题： </TD>
    <TD><s:textfield name="title" id="title" cssClass="text1" maxlength="30" /><font id="titleTip"></font></TD>
  </TR>

  <TR id=xq1>
    <TD class=t><B class=red>*</B> 所在小区： </TD>
    <TD><s:textfield name="housing" id="housing" cssClass="text4" maxlength="30" /><font id="housingTip"></font></TD>
  </TR>
  <TR>
    <TD class=t><B class=red>*</B>地铁沿线： </TD>
    <TD><s:select list="houseMetroTypeList" name="houseMetroType" id="houseMetroType" listKey="key" listValue="value"></s:select></TD>
  </TR>
  <TR>
    <TD class=t><B class=red>*</B>整套户型： </TD>
    <TD>
    <input id="room" name="room" class="text3" type="text" maxLength="1"/> 室 
	<input id="parlor" name="parlor" class="text3" type="text" maxLength="1"/> 厅 
	<input id="wc" name="wc" class="text3" type="text" maxLength="1"/> 卫 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	第 <input id="floor" name="floor" class="text3" type="text" maxLength="2"/> 层，
	共 <input id="totalfloor" name="totalfloor" class="text3" type="text" maxLength="2"/> 层
	<font id="roomTip"></font>
	</TD>
  </TR>
  <!--整租开始-->
  <TR>
    <TD class=t> 面 积： </TD>
    <TD>
    <input id="mianji" name="mianji" class="text3" type="text"  maxLength="4"/>平米&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	<s:select list="houseTypeList" name="houseType" id="houseType" listKey="key" listValue="value"></s:select>
	&nbsp;
	<s:select list="houseFitTypeList" name="houseFitType" id="houseFitType" listKey="key" listValue="value"></s:select>
	&nbsp;
	<s:select list="houseTowardTypeList" name="houseTowardType" id="houseTowardType" listKey="key" listValue="value"></s:select>
	<font id="mianjiTip"></font>
	</TD>
  </TR>
  <!--整租结束-->
  <TR>
    <TD class=t><B class=red>*</B> 租 金： </TD>
    <TD>
	<input id="minPrice" name="minPrice" class="text3 gray" type="text"  maxLength=5/> 元/月 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	<s:select list="houseHirepayTypeList" name="houseHirepayType" id="houseHirepayType" listKey="key" listValue="value"></s:select>
	<font id="minPriceTip"></font>
	</TD>
  </TR>
  <TR>
    <TD class=t>房屋配置： </TD>
    <TD>
    <s:checkboxlist list="houseAllocationList" name="houseAllocation" id="houseAllocation" listKey="key" listValue="value"></s:checkboxlist>
	</TD>
  </TR>
  <TR>
    <TD class=t><B class=red>*</B> 补充说明： </TD>
    <TD style="HEIGHT: 70px"><s:textarea id="content" rows="15" cols="70" name="content"></s:textarea><font id="contentTip"></font></TD>
 </TR>
 <TR id=pdv>
 <TD class=t valign="top">上传照片： </TD>
    <TD><div id="uploadPic"><ul></ul></div>
	  <div id="uploader"></div>
      <span>可上传 6 张图片，每张最大2M，支持jpg/gif格式。上传图片越小，上传越快。</span><br /><img src="/images/qqjt.jpg"  border="0" /></TD>
  </TR>
  <TR>
    <TD class=t><B class=red>*</B> 联系人： </TD>
    <TD>
    <s:textfield name="linkman" id="linkman" cssClass="text2" maxlength="6" /> &nbsp;
	<label><s:checkbox name="biz" id="biz" cssClass="base"></s:checkbox>我是经纪人</label>
	<span class="jingjiren" id="id_agent_tip">
		<div id="agent_tip" class="jingjirencon" style="display:none;"> 
			<span name="biz_shenfen">您已被系统判定为经纪人身份</span> 
			<p>什么是个人身份？</p> <span>1、业主直接出租/出售<br />2、个人转租</span> 
			<p>什么是经纪人身份？</p> <span>1、房产经纪公司、代理公司的经纪人(与是否有中介费无关)<br />2、二房东<br />3、进行直租/直售的物业公司、开发商</span> 
		</div> 
	</span>
	<font id="linkmanTip"></font>
	</TD>
  </TR>
  <TR>
    <TD class=t><B class=red>*</B> 商家网店： </TD>
    <TD>
	<label><s:checkbox name="profile" id="profile" cssClass="base"></s:checkbox>在商家网店上显示</label>
	</TD>
  </TR>
  <TR>
    <TD class=t><B class=red>*</B> 手机或电话： </TD>
    <TD><s:textfield name="phone" id="phone" cssClass="text2" /><font id="phoneTip"></font></TD>
 </TR>
  <TR>
    <TD class=t></TD>
    <TD><input type="submit" id="fabu" class="fabu1" value="　　发布　　" ct="submit" /></TD>
 </TR>
</TBODY>
</TABLE>
<DIV class=hr_s></DIV></SPAN></FORM>
</ul>
</DIV>
<div class="content">
<s:include value="/foot.jsp" />
</div>
<script type="text/javascript">
bkLib.onDomLoaded(nicEditors.allTextAreas);
$(document).ready(function(){
	showBizTip();
	createUploader();
	$.formValidator.initConfig({formid:"add",errorfocus: true});
	$("#title").formValidator({onshow:"请输入标题",onfocus: "6-30个字，不允许填写电话和特殊符号"}).regexValidator({ regexp: "^[\\s\\S]*$", onerror: "不能填写电话和特殊符号！" }).regexValidator({ regexp: "^[\\s\\S]{6,}$", onerror: "标题不足6个字!" }).regexValidator({ regexp: "^(.){6,30}$", onerror: "标题应为6-30个字！" });
	$("#housing").formValidator({onshow:"请输入房源所在小区",onfocus: "1~30个字，不能填写电话和特殊符号"}).regexValidator({ regexp: "\\S+", onerror: "请输入房源所在小区" }).regexValidator({ regexp: "^((?!电话|手机|联系方式|号码).)*$", onerror: "小区里不能填写电话" }).regexValidator({ regexp: "^(.){1,30}$", onerror: "小区名称应为1~30个字！" });
	$("#minPrice").formValidator({onshow:"租金空为面议",onfocus: "租金只能为整数",'empty':true,onempty:"租金空为面议"}).regexValidator({ regexp: "^\\S+$", onerror: "请填写租金" }).regexValidator({ regexp: "^[1-9]\\d{0,4}$", onerror: "租金为0以外的整数" });
	$("#room").formValidator({ tipid: "roomTip",onshow:"请填写户型",onfocus: "填写数字，不能是“0”。"}).regexValidator({ regexp: "^\\S+$", onerror: "请填写户型" }).regexValidator({ regexp: "^[1-9]$", onerror: "户型必须为数字，居室不能填写0" }); 
	$("#parlor").formValidator({ tipid: "roomTip",onshow:"请填写户型",onfocus: "填写数字"}).regexValidator({ regexp: "^\\S+$", onerror: "请填写户型" }).regexValidator({ regexp: "^[0-9]$", onerror: "户型必须为数字，居室不能填写0" }); 
	$("#wc").formValidator({ tipid: "roomTip",onshow:"请填写户型",onfocus: "填写数字"}).regexValidator({ regexp: "^\\S+$", onerror: "请填写户型" }).regexValidator({ regexp: "^[0-9]$", onerror: "户型必须为数字，居室不能填写0" }); 
	$("#floor").formValidator({tipid: "roomTip",onshow:"请填写楼层",onfocus: "填写整数，不能是“0”。"}).regexValidator({ regexp: "^\\S+$", onerror: "请填写楼层" }).regexValidator({ regexp: "^[1-9]\\d{0,1}$|^-\\d$", onerror: "楼层必须为数字，不能是“0”。" }).compareValidator({ desid: "totalfloor", operateor: "<=", onerror: "总楼层不能小于所在楼层", datatype: "number" });
	$("#totalfloor").formValidator({ tipid: "roomTip",onshow:"请填写楼层",onfocus: "填写整数，"}).regexValidator({ regexp: "^\\S+$", onerror: "请填写楼层" }).regexValidator({ regexp: "^[1-9]\\d{0,1}$", onerror: "楼层必须为数字，不能是“0”。" }).compareValidator({ desid: "floor", operateor: ">=", onerror: "总楼层不能小于所在楼层", datatype: "number" });
	$("#mianji").formValidator({onshow:"面积可以为空",onfocus: "填写整数，允许一位小数",'empty':true,onempty:"面积可以为空" }).regexValidator({ regexp: "^[1-9]\\d{0,4}(\\.\\d{1,1})?$", onerror: "面积为0以外的整数，允许一位小数" });
	$("#content").formValidator({onshow:"请填写补充说明",onfocus: "10~2000个字之间" }).regexValidator({ regexp: "^[\\s\\S]*$", onerror: "请填写补充说明" }).regexValidator({ regexp: "^[\\s\\S]{10,}$", onerror: "房源描述不足10个字" }).regexValidator({ regexp: "^([\\s\\S]){10,2000}$", onerror: "内容应在10~2000个字之间" });
	$("#phone").formValidator({onshow:"请填写电话号码",onfocus: "请正确填写电话号码，"}).regexValidator({ regexp: "(^(0\\d{2,3})?-?([2-9]\\d{6,7})(-\\d{1,5})?$)|(^((\\(\\d{3}\\))|(\\d{0}))?(13|14|15|18)\\d{9}$)|(^(400|800)\\d{7}(-\\d{1,4})?$)|(^(95013)\\d{6,8}$)", onerror: "电话填写错误。请参照格式填写：87654321或138********" });
	$('#linkman').formValidator({onshow:"请输入联系人",onfocus:'2～6个字，不能填写电话和特殊符号'}).regexValidator({ regexp: "\\S+", onerror: "请输入联系人" }).regexValidator({ regexp: "^(.){2,6}$", onerror: "联系人不足2个字" }).regexValidator({ regexp: "^[\\w\\d\\s\\u4e00-\\u9fa5]*$", onerror: "联系人不能填写特殊符号" });
	
});
function tojump(obj){
	var url = location.href; 
	url = url.TrimEnd('/');
	url = url.replace(location.search, '');
	url += '?bid=<s:property value="bid"/>&sid=<s:property value="sid"/>&areaid=<s:property value="areaId"/>&tid=<s:property value="tid"/>'
	if(obj.value != 2) {
		url2 = url.replace('zufang', 'hezu');
		url2 += '&typeid=' + obj.value;
	} else { 
		url2 = url.replace('hezu', 'zufang'); 
	} 
	if(url != url2){
		location.href = url2; 
	} 
};
String.prototype.TrimEnd = function(c){
	return this.replace(new RegExp(c + '*$'), ''); 
}; 
function isAdd(){ return '0' == '0'; } 
function showBizTip(){
	var cbx = $(':checkbox[name="isbiz"]'); 
	if(cbx.attr('disabled')){
		cbx.parent().hide(); 
		cbx.parent().after('<font color="red">经纪人</font>');
	} else { 
		$('span[name="biz_shenfen"]').hide(); 
	} 
	$("#id_agent_tip").hover(function(){ $('#agent_tip').css('display',''); }, function(){ $('#agent_tip').css('display','none'); } ); 
} 
function checkHireTypeValue(){
	var obj = $(':radio[name="hireType"]:checked'); 
	if(obj.length == 0){ 
		alert('请选择出租方式'); 
		return false; 
	} 
	var _v = obj.val(); 
	if(_v != 2){ 
		alert('错误的出租方式，请重新选择。');
		return false; 
	} 
	return true; 
}
function createUploader(){            
	var uploader = new qq.FileUploader({
	element: document.getElementById('uploader'),
	action: '<s:property value="domain"/>/upPhoto.action?action=infoPic',
	allowedExtensions:['jpg','gif','jpeg']
    });           
}
</script>
</body>
</html>